<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>公安机关现场勘验信息系统</title> 
    <link href="css/base.css" rel="stylesheet">
    <link href="css/login/login.css" rel="stylesheet">
	<link rel="stylesheet" href="jquery-easyui-1.5.3/themes/default/easyui.css">
	<link href="jquery-easyui-1.5.3/themes/icon.css" rel="stylesheet">

</head> 
<body class="default">
	<div class="login-hd">
		<div class="left-bg"></div>
		<div class="right-bg"></div>
		<div class="hd-inner">
			<span class="logo"></span>
			<!--<span class="split"></span>
			<span class="sys-name">采购协同平台</span>-->
		</div>
	</div>
	<div class="login-bd">
		<div class="bd-inner">
			<div class="inner-wrap">
				<div class="lg-zone">
					<div class="lg-box">
						<div class="lg-label"><h4>用户登录</h4></div>
						<div class="alert alert-error">
			              <i class="iconfont">&#xe62e;</i>
			              <span>请输入用户名</span>
			            </div>
						<form class="easyui-form" method="post" data-options="novalidate:true">
							<div class="lg-username input-item clearfix">
								<i class="iconfont">&#xe60d;</i>
								<input type="text" name="username" data-options="required:true'" placeholder="请输入用户名">
							</div>
							<div class="lg-password input-item clearfix">
								<i class="iconfont">&#xe634;</i>
								<input type="password" name="password" data-options="required:true'" placeholder="请输入密码">
							</div>
							<div class="lg-check clearfix">
								<div class="input-item">
									<i class="iconfont">&#xe633;</i>
									<input type="text" placeholder="验证码">
								</div>
								<span class="check-code">XD34F</span>
							</div>
							<!--<div class="tips clearfix">
								<label><input type="checkbox" checked="checked">记住用户名</label>
								<a href="javascript:;" class="register">立即注册</a>
								<a href="javascript:;" class="forget-pwd">忘记密码？</a>
							</div>-->
							<div class="enter">
								<a href="javascript:;" class="purchaser" onClick="submitForm()">登录</a>
								<a href="javascript:;" class="supplier" onClick="javascript:window.location='main.html'">PKI登录</a>
							</div>
						</form>
					</div>
				</div>
				<div class="lg-poster"></div>
			</div>
		</div>
	</div>
	<div class="login-ft">
		<div class="ft-inner">
			<div class="about-us">
				<a href="javascript:;">关于我们</a>
				<a href="javascript:;">法律声明</a>
				<a href="javascript:;">服务条款</a>
				<a href="javascript:;">联系方式</a>
			</div>
			<div class="address">地址：湖南省长沙市岳麓区西中心&nbsp;Copyright&nbsp;©&nbsp;2019&nbsp;-&nbsp;2020&nbsp;湖南联赢&nbsp;版权所有</div>
			<div class="other-info">建议使用IE8及以上版本浏览器&nbsp;</div>
		</div>
	</div>
</body> 
</html>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
<script type="text/javascript">
	function submitForm(){
		// $('.easyui-form').form('submit',{
		// 	onSubmit:function(){
		// 		return $(this).form('enableValidation').form('validate');
		// 	}
		// });
		var username = $("input[name=username]").val();
		var password = $("input[name=password]").val();
		if(username == ''){
			$.messager.alert('提示信息','用户名不能为空!','error');
			return false;
		}
		if(password == ''){
			$.messager.alert('提示信息','密码不能为空!','error');
			return false;
		}
		$.ajax({
			type: "post",
			url: "getLogin",
			data:{"username":username,"password":password},
			cache: false,
			async: false,
			success: function(data){
			  if(data == "登录成功"){
				window.location.href="main";
			  }else{
				$.messager.alert('提示信息','无效用户名或密码,请重试!','error')
			  }
			},
			error: function(data){
				if(data == "登录失败"){
					$.messager.alert('提示信息','无效用户名或密码,请重试!','error')
				}
			}
		});
	}
</script>
